<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JQ</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            float: left;
            margin: 20px;
            border: 1px solid #000;
            box-sizing: border-box;
            /* display: none; */
        }
    </style>
</head>
<body>
    <div class="box">1</div>
    <div class="box"></div>
    <div class="box">
        <span></span>
    </div>
    <div class="box">1</div>
    <div class="box other"></div>
    <div class="box"></div>
    <div class="box" style='opacity:0;background: #58bc58;'>2</div>

    <script src="./js/jquery.3.5.1.js"></script>
    <script>
        $(function(){
            /* $('.box').css({
                width:100,
                height:'100px',
                backgroundColor:"blue"
            }) */

            // 1.排除选择器
            /* $('.box:not(.other)').css({
                backgroundColor:"blue"
            }) */

            // 2.筛选选择器
            /* $('.box:has(span)').css({
                backgroundColor:"pink"
            }) */

            // 3.可见性过滤器
            /* $('.box:hidden').css({
                display:'block'
            }) */
            /* $('.box:visible').css({
                display:'none'
            }) */

            // 4.内容选择器
            $('.box:contains(1)').css({
                backgroundColor:"red"
            })

        })
    </script>
</body>
</html>